import { Component } from '@angular/core';
import { IonicPage, NavController, NavParams } from 'ionic-angular';
import { BusiProvider } from '../../providers/busi/busi';
import { NativeProvider } from '../../providers/native/native';

/**
 * Generated class for the MymettinglistPage page.
 *
 * See https://ionicframework.com/docs/components/#navigation for more info on
 * Ionic pages and navigation.
 */

@IonicPage()
@Component({
  selector: 'page-mymettinglist',
  templateUrl: 'mymettinglist.html',
})
export class MymettinglistPage {
  selectedseg="0";
  mettinglist=[];
  constructor(public navCtrl: NavController, public navParams: NavParams,public busi:BusiProvider,private native:NativeProvider) {
  }

  ionViewDidEnter(){
    this.getMettingList();
  }

  ionViewDidLoad() {
    console.log('ionViewDidLoad MymettinglistPage');
  }

  getMettingList(){
    this.busi.getMyMettingList(this.selectedseg).subscribe(
      data=>{
        this.mettinglist = data.mettinglist;
      },err=>{

      }
    );
  }

  gotoMettingDetail(metting){
    this.navCtrl.push("MettingdetailPage",{mettingid:metting.id,intype:'0',wfq:this.selectedseg});
  }
  addMetting(){
      this.navCtrl.push("AddmettingPage");
  }
}
